#include<stdio.h>

struct student
{
	int id;
	char *name;
	char gender;
	int age;
};

void show(const struct student* stu){
	printf("学号：%d, 姓名：%s, 性别：%c, 年龄：%d\n",
			stu->id,
			stu->name,
			stu->gender,
			stu->age);
}

int main()
{
	struct student stu[] = {
			{10001,"宋远桥",'M',50},
			{10002,"俞莲舟",'M',45},
			{10003,"俞岱岩",'M',42},
			{10004,"张松溪",'M',40},
			{10005,"张翠山",'M',36},
			{10006,"殷梨亭",'M',32},
			{10007,"莫声谷",'M',30}
	      };
	//遍历结构体数组
	for(int i=0; i<7; i++){
		show(&stu[i]);
	}
	printf("---------------------------------------------\n");
	struct student *p = stu;
	for(int i=0; i<7; i++){
		show(p++);
	}

	return 0;
}
